﻿using System;
using System.Web;
using WebUI.Lang;


namespace WebUI
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        public string groupname = "";
        public string loginname = "";
     

        public string GetText(string name)
        {
            return BasePage.GetText(name);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            loginname = Request.Cookies["adler_userid"].Value;
            groupname = Request.Cookies["adler_userrole"].Value;
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(groupname))
                    groupname = Request.Cookies["adler_userrole"].Value;                
                if (!String.IsNullOrEmpty(loginname))
                    loginname = Request.Cookies["adler_userid"].Value;
                else
                    Response.Redirect(Helpers.link.ToAdlerLogin("AdlerLogin.aspx"));
            }   
        }

        protected void linkLogout_Click(object sender, EventArgs e)
        {
            Response.Cookies.Get("adler_userid").Value = null;
            Response.Cookies.Get("adler_userrole").Value = null;
            Response.Redirect(Helpers.link.ToAdlerLogin("AdlerLogin.aspx"));
        }

        

        


    }
}